package com.stropheware.droidDefense;

import com.stropheware.droidDefense.R;

import android.app.Activity;
import android.media.MediaPlayer;

public class GameAudio {
	
	/*
	 * Reference to R.java location of specific Audio File
	 */
	private int genRLocation;
	
	/*
	 * true = track will loop
	 * false = track will play once
	 */
	private boolean isLoop;
	
	/*
	 * Each GameAudio has its own MediaPlayer
	 * MediaPlayer can be considered a reference to the on-board sound mixer
	 */
	private MediaPlayer mediaPlayer;
	
	/*
	 * Activity associated with Audio
	 * Passed in during constructor
	 */
	private Activity activity;
	
	/*
	 * Name associated with audio
	 */
	private String name;
	
	public GameAudio(String name, int genRLocation, boolean isLoop, Activity activity) {
		this.name = name;
		this.genRLocation = genRLocation;
		this.isLoop = isLoop;
		this.activity = activity;
		mediaPlayer =  MediaPlayer.create(activity.getBaseContext(), genRLocation);
		mediaPlayer.setLooping(isLoop);
	}
	
	public boolean isLoop() {
		return isLoop;
	}
	
	public int getGenRLocation() {
		return genRLocation;
	}
	
	public MediaPlayer getMediaPlayer() {
		return mediaPlayer;
	}
	
	public Activity getActivity() {
		return activity;
	}
	
	public String getName() {
		return name;
	}

}
